import { createWebHashHistory, createWebHistory,createRouter } from 'vue-router' 

import Home from "../view/Home.vue"; //引入页面跟vue2的引入方式相同
const routes = [
	{ path: '/', name: "Index", component: Home }, //此处name不能与下面Home的 name相同否则页面报错
	{
		path: "/home",
		name: "Home",
		component: Home,
	},
	{
		path: "/test",
		name: "Test",
		component: () =>
			import(/* webpackChunkName: "about" */ "../view/Test.vue"),
	},
];
const router = createRouter({
	history: createWebHashHistory(),
    	//createWebHistory 方法返回的是 History 模式,createWebHashHistory 方法返回的是 Hash 模式
	routes,
});

export default router;